{% extends 'base.html' %}
{% block main %}
    <div class="content-wrap">
        <div id="content" class="content">
            <section id="posts" class="posts-expand">
                {% for post in posts %}
                    <article class="post post-type-normal">
                        <header class="post-header">
                            <h1 class="post-title">
                                <a class="post-title-link" href="{{ post.get_absolute_url }}">
                                    {{ post.title }}
                                </a>
                            </h1>
                            <div class="post-meta">
                              <span class="post-time">
                                <span class="post-meta-item-icon">
                                <i class="fa fa-calendar-o"></i>
                              </span>
                              <span class="post-meta-item-text">发表于</span>
                                <time title="创建于" datetime="{{ post.publish }}">
                                {{ post.publish }}
                                </time>
                              </span>
                                <span class="post-category"><span class="post-meta-divider">|</span>
                                    <span class="post-meta-item-icon"><i class="fa fa-folder-o"></i></span>
                                    <span class="post-meta-item-text">分类于</span>
                                    <span><a href="{% url 'blog:category_detail' post.category.name %}" rel="index">
                                            <span>{{ post.category.name }}</span>
                                          </a>
                                    </span>
                              </span>
                                <span class="post-comments-count">
                                    <span class="post-meta-divider">|</span>
                                    <span class="post-meta-item-icon">
                                      <i class="fa fa-comment-o"></i>
                                    </span>
                                    <a href="{{ post.get_absolute_url }}#comments">
                                      <span class="post-comments-count disqus-comment-count"
                                            data-disqus-identifier="{{ post.get_absolute_url }}">{{ post.comments.count }} Comments</span>
                                    </a>
                              </span>
                                <span id="{{ post.get_absolute_url }}" class="leancloud_visitors"
                                      data-flag-title="{{ post.title }}">
                                     <span class="post-meta-divider">|</span>
                                     <span class="post-meta-item-icon">
                                     <i class="fa fa-eye"></i>
                                     </span>
                                     <span class="post-meta-item-text">
                                         阅读次数
                                     </span>
                                    <span class="leancloud-visitors-count">{{ post.views }}</span>
                              </span>
                            </div>
                        </header>

                        <div class="post-body">
                            {{ post.summary|safe }}...
                            <!--noindex-->
                            <div class="post-button text-center">
                                <a class="btn" href="{{ post.get_absolute_url }}" rel="contents">
                                    阅读全文 »
                                </a>
                            </div>
                            <!--/noindex-->
                        </div>


                        <footer class="post-footer">
                            <div class="post-eof"></div>
                        </footer>
                    </article>
                {% endfor %}
            </section>
            <!--分页-->{% if is_paginated %}
            {% include 'blog/pagination.html' with page_obj=page_obj first=first left=left right=right last=last left_has_more=left_has_more right_has_more=right_has_more %}
        {% endif %}
        </div>
    </div>
{% endblock %}
